package org.ctgu.controller;

import lombok.extern.slf4j.Slf4j;
import org.ctgu.entity.Employee;
import org.ctgu.entity.dto.EmployeePageQueryDTO;
import org.ctgu.result.PageResult;
import org.ctgu.result.Result;
import org.ctgu.service.EmployeeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/employee")
@Slf4j
public class EmployeeController {

    @Autowired
    private EmployeeService employeeService;

    @GetMapping("/page")
    public Result<PageResult> add(@RequestBody EmployeePageQueryDTO employeePageQueryDTO) {
        log.info("维修人员分页：{}", employeePageQueryDTO);
        PageResult pageResult = employeeService.page(employeePageQueryDTO);
        return Result.success(pageResult);
    }

}
